import "./App.css";
import React,{ useState,useEffect } from "react";
import { createFiveProvider ,useFiveCurrentState} from "@realsee/five/react";
import axios from 'axios';
import Main from './main'
// work.json 的数据 URL
// const workURL = "https://vrlab-public.ljcdn.com/release/static/image/release/five/work-sample/07bdc58f413bc5494f05c7cbb5cbdce4/work.json";
const FiveProvider = createFiveProvider();
const App = () => {
  // 空间数据
  let [kjdata,setKjdata]=useState(null)
  useEffect(()=>{
    axios.get('http://218.249.218.102:18889/open/v1/entity/vr?vr_code=802kbe37PwJOwMYqG8').then((res)=>{
        setKjdata(kjdata=res.data.data)
    })
  },[])
  // 页面主体
  return kjdata && <FiveProvider initialWork={kjdata}>
      <Main/>
  </FiveProvider>;
};
export default App;
